use clap::{arg, Command};

pub fn cli() -> Command {
  Command::new("mcboot")
    .about("a minecraft download and boot cli application")
    .version("0.0.1")
    // .author("etcix")
    .subcommand_required(true)
    .arg_required_else_help(true)
    .subcommand(
      Command::new("search")
        .about("search minecraft version")
        .arg(arg!([VERSION] "the required version"))
        .arg(
          arg!(
              -t --type <TYPE> "build type of minecraft"

          )
          .value_parser(["release", "snapshot", "old_beta", "old_alpha"])
          .require_equals(true)
          .default_value("release")
          .default_missing_value("release"),
        ),
    )
    .subcommand(
      Command::new("download")
        .about("download a version, give a version no")
        .arg(arg!(<VERSION> "version number, give me a version number from search"))
        .arg_required_else_help(true),
    )
    .subcommand(
      Command::new("boot")
        .about("boot a version, give a version no")
        .arg(arg!(<VERSION> "boot and launch one, give me a version number"))
        .arg_required_else_help(true),
    )

  // IMPROVE: maybe add subcommand `list` to list all downladed version
  // <this program> list
}
